package javaStudy;

/**
 * Created by qq65827 on 2015/2/5.
 */
public class ArrayEquals {

    public static boolean equals(int[] a, int[] a1) {
        if (a == a1) {
            return true;
        }
        if (a == null || a1 == null) {
            return false;
        }

        int length = a.length;
        if (a1.length != length) {
            return false;
        }
        for (int i = 0; i < length; i++) {
            if (a[i] != a1[i]) {
                return false;
            }
        }
        return true;
    }
}
